package main
import "fmt"
func main(){
	var a []int
	fmt.Printf("a type is :%T\n", a)
	fmt.Printf("len = %d\tcap = %d\n", len(a), cap(a))
	
	for i := 0; i < 100; i++{
		a = append(a, i)
	}
	fmt.Printf("len = %d\tcap = %d\n", len(a), cap(a))
	
	/*那么用法，跟数组是一个道理*/
	for i := 0; i < len(a); i++{
		fmt.Printf("a[%d] = %d\t", i, a[i])
		if i % 5 == 0{
			fmt.Println()	//为了让输出结果好看点，这里整个换行
		}
	}
	
}
